<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>出生年月分布</title>
	<meta name="decorator" content="default"/>
	<script src="${ctxStatic}/echarts/childBaseinfoMonthsEcharts.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			//为年份赋值
			var curYear = new Date().getFullYear();
			var curMouth = new Date().getMonth() +1;
			for(var i=0;i<30 ;i++){
				$("#birthday").append("<option value="+(curYear-i)+">"+(curYear-i)+"</option>");//添加option
			}
			$("#birthday").val(curYear).select2();
			//$("#birthday").val('${exportChildhelp.yearStr}').select2();
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		function downExcel(){
			top.$.jBox.confirm("确认要导出出入库数据吗？","系统提示",function(v,h,f){
				if(v=="ok"){
					$("#searchForm").attr("action","${ctx}/child/childBaseinfo/exportExcel");
					$("#searchForm").submit();
				}
			},{buttonsFocus:1});
			top.$('.jbox-body .jbox-icon').css('top','55px');
		}
		
		function reset(){
			$("#searchForm").reset();
			var selectVal = $("form:select");
			for(var i=0;i<selectVal.lengeth;i++){
				selectVal[i].options[0].selected= true;
			}
		} 
		
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/child/childBaseinfo/">出生年月分布</a></li>
<%-- 		<shiro:hasPermission name="child:childBaseinfo:edit"><li><a href="${ctx}/child/childBaseinfo/form">个案信息查询添加</a></li></shiro:hasPermission> --%>
	</ul>
	<form:form id="searchForm" modelAttribute="childBaseinfo" action="${ctx}/child/childBaseinfoMonths/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	<div class="breadcrumb">
		<table class="table table-bordered">	
			<tr>
				<th>地区名称：</th>
				<td>
					<form:select path="area" class="span2 minWidth" onchange="change()">
						<form:option value="" label="--请选择--"/>
						<form:options items="${area}" itemLabel="name" itemValue="code" htmlEscape="false"/>
					</form:select>
				</td>
				<th>年度：</th>
				<td>
					<form:select path="birthday" cssStyle="width: 91px;"/>
				</td>
				<%-- <td>
					<input name="startBirthday" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
						value="<fmt:formatDate value="${childBaseinfo.birthday}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy',isShowClear:true});"/>&nbsp;至
						
					<input name="endBirthday" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
						value="<fmt:formatDate value="${childBaseinfo.birthday}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				</td> --%>
			</tr>
			<tr>
				<th>居住属性：</th>
				<td>
					<form:select path="reside" class="span2 minWidth">
						<form:option value="" label="--请选择--"/>
						<form:options items="${fns:getDictList('reside')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</td>
				<th>建档日期：</th>
				<td>
					<input name="startUpdateDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
						value="<fmt:formatDate value="${childBaseinfo.birthday}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>&nbsp;至
					<input name="endUpdateDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
						value="<fmt:formatDate value="${childBaseinfo.birthday}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				</td>
			</tr>
 
			<tr>
				<th>儿童状态：</th>
				<td>  
					<form:checkboxes path="situation" items="${fns:getDictList('child_situation')}" itemValue="value"/>
				</td>
 				<%-- <th>条码：</th>
  				<td>
					<form:select path="gender" class="span2 minWidth">
					<form:option value="" label="--请选择--"/>
					</form:select>
				</td> --%>
			</tr>
		</table>
	</div>
		<ul class="ul-form breadcrumb">
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="btns"><input onclick="reset()"  class="btn btn-primary" type="button" value="重置"/></li>
			<li class="btns"><input onclick="downExcel()"  class="btn btn-primary" type="button" value="导出"/></li>
			<li class="btns"><input onclick="showEcharts()"  class="btn btn-primary" type="button" value="隐藏图表"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	
	<!-- echarts图表 -->
	
		<div id="showEcharts" style="min-width:750px; height: 300px;margin-bottom:20px;"></div>
	
	
	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			 
			<tr>
				<th>地区名称</th>
				<th>1月</th>
				<th>2月</th>
				<th>3月</th>
				<th>4月</th>
				<th>5月</th>
				<th>6月</th>
				<th>7月</th>
				<th>8月</th>
				<th>9月</th>
				<th>10月</th>
				<th>11月</th>
				<th>12月</th>
				<th>合计</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="childBaseinfoMonths">
			<tr>
				 <td>
				 	${childBaseinfoMonths.name}
				 </td>
				 <td>
				 	${childBaseinfoMonths.january}
				 </td>
				 <td>
				 	${childBaseinfoMonths.february}
				 </td>
				 <td>
				 	${childBaseinfoMonths.march}
				 </td>
				 <td>
					${childBaseinfoMonths.april}
				 </td>
				 <td>
				 	${childBaseinfoMonths.may}
				 </td>
				 <td>
				 	${childBaseinfoMonths.june}
				 </td>
				 <td>
				 	${childBaseinfoMonths.july}
				 </td>
				 <td>
				 	${childBaseinfoMonths.august}
				 </td>
				 <td>
				 	${childBaseinfoMonths.september}
				 </td>
				 <td>
				 	${childBaseinfoMonths.october}
				 </td>
				 <td>
				 	${childBaseinfoMonths.november}
				 </td>
				 <td>
				 	${childBaseinfoMonths.december}
				 </td>
				 <td>
				 	${childBaseinfoMonths.january+childBaseinfoMonths.february+childBaseinfoMonths.march+childBaseinfoMonths.april+
				 	childBaseinfoMonths.may+childBaseinfoMonths.june+childBaseinfoMonths.july+childBaseinfoMonths.august+
				 	childBaseinfoMonths.september+childBaseinfoMonths.october+childBaseinfoMonths.november+childBaseinfoMonths.december}
				 </td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>